import request from '@/utils/request'

// ----------------------------------------------------委外维修 接口文档----------------------------------------------------------------------------

// 获取委外维修列表---------------------------------------- 
export function list (params) {
  return request({
    url: '/function/outsource/list',
    method: 'get',
    params
  })
}

// 获取委外维修列表详情，两个页面通用接口---------------------------------------- 
export function listDetail (id) {
  return request({
    url: '/function/outsource/' + id,
    method: 'get',
  })
}

//新增： 获取设备部门列表----------------------------------------
export function listDept (params) {
  return request({
    url: '/system/dept/list',
    method: 'get',
    params
  })
}

//新增： 获取设备列表----------------------------------------
export function listEquipmentAccount (params) {
  return request({
    url: '/function/equipment/account/partInfo/list',
    method: 'get',
    params
  })
}



//新增： 获取故障维修字典列表----------------------------------------
export function listDictionary (params) {
  return request({
    url: '/system/dict/data/list',
    method: 'get',
    params
  })
}

// 新增：获取委外服务商信息，供应商接口
export function supplierlist (params) {
  return request({
    url: '/function/supplier/list',
    method: 'get',
    params
  })
}

// 新增：获取审核人与抄送人信息
export function getuserlist (params) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params
  })
}

//新增： 提交接口----------------------------------------
export function add (data) {
  return request({
    url: '/function/outsource',
    method: 'post',
    data
  })
}
//提交申请： 提交接口----------------------------------------
export function addapply (data) {
  return request({
    url: '/function/outsource/apply',
    method: 'post',
    data
  })
}

//提交申请： 供应商唯一性----------------------------------------
export function checkUniqeByName (params) {
  return request({
    url: '/function/supplier/checkUniqeByName',
    method: 'get',
    params
  })
}

// 审核流程：两个页面通用接口---------------------------------------
export function auditDatail (params) {
  return request({
    url: '/function/audit/outsource/list',
    method: 'get',
    params
  })
}

// 维修完毕：提交接口---------------------------------------
export function assignPut (data) {
  return request({
    url: '/function/repair/outsource/resolved',
    method: 'put',
    data
  })
}

// 维修完毕：换下备件列表---------------------------------------- 
export function listreplaceRecord (params) {
  return request({
    url: '/function/equipment/consumable/replaceRecord/list',
    method: 'get',
    params
  })
}

// 开始维修：接口---------------------------------------
export function updateCreate (data) {
  return request({
    url: '/function/repair/outsource/start',
    method: 'put',
    data
  })
}

// 重新申请：接口---------------------------------------
export function updateReapply (id) {
  return request({
    url: '/function/outsource/reapply/' + id,
    method: 'post',
  })
}
// 提交/撤销：撤销接口---------------------------------------
export function cancelApply (id) {
  return request({
    url: '/function/outsource/cancelApply/' + id,
    method: 'put',
  })
}

// ----------------------------------------------------与我相关 接口文档----------------------------------------------------------------------------
// 获取与我相关列表---------------------------------------- 
export function listRight (params) {
  return request({
    url: '/function/outsource/my/list',
    method: 'get',
    params
  })
}


// 审核：提交接口---------------------------------------- 
export function updateCreateRight (data) {
  return request({
    url: '/function/audit/outsource',
    method: 'put',
    data
  })
}
